using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Presenters;
using Dominio;


public partial class AdmSec : AbstractView
{
    private AdmSecPresenter presenter;
    public AdmSec()
    {
        presenter = new AdmSecPresenter();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        this.LogedIn();

        this.PatGrid.DataSource = presenter.getPatList();
        this.PatGrid.DataBind();
        this.familyGrid.DataSource = presenter.getFamilyList();
        this.familyGrid.DataBind();
    }

protected void  familyGrid_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
    this.PatGrid.DataSource = presenter.getFiltredPat(int.Parse(this.familyGrid.Rows[e.NewSelectedIndex].Cells[1].Text));
    this.PatGrid.DataBind();
}
    protected void nuevaFamilia_Click(object sender, EventArgs e)
    {
        namelbl.Visible = true;
        nametxt.Visible = true;
        nuevaFamilia.Enabled = false;
        this.PatGrid.Columns[0].Visible = true;
    }
    protected void nuevaPatente_Click(object sender, EventArgs e)
    {
        countrylbl.Visible = true;
        countrytxt.Visible = true;
        nuevaPatente.Enabled = false;
    }
}
